#!/bin/bash
#
#
COMPRESS_PATH=~/NetBeansProjects/compress
SERVICE_PATH=src/main/webapp/WEB-INF/scripts

echo "compress *.js and *.css"

#----------------MooTools---------------------
# take from compuvest.com and put under apache

#-------------------------------------
# js
cd $SERVICE_PATH
cat ./js/blure.js ./js/cv_new.js ./js/pictips.js ./js/mlform.js > temp.js

/usr/bin/java -classpath $COMPRESS_PATH/rhino-1.6R7.jar \
              -classpath $COMPRESS_PATH/jargs-1.0.jar \
              -jar $COMPRESS_PATH/yuicompressor-2.4.2.jar \
              -o ../../incl/cvm.js ./temp.js

#cp ./temp.js ../../js/cvm.js
rm temp.js
echo "*.js Done"

#-------------------------------------
# css
cat ./css/cv.css ./css/cv_new.css > temp.css
/usr/bin/java -classpath $COMPRESS_PATH/rhino-1.6R7.jar \
              -classpath $COMPRESS_PATH/jargs-1.0.jar \
              -jar $COMPRESS_PATH/yuicompressor-2.4.2.jar \
              -o ../../incl/cvm.css ./temp.css

#cp ./temp.css ../../css/cv.css
rm temp.css
echo "*.css Done"

exit 0
